package com.axjy.user.client;

import com.axjy.commons.client.UserClient;
import com.axjy.commons.pojo.TpUser;
import com.axjy.user.mapper.UserMapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
public class UserClientImpl implements UserClient {

    @Resource
    private UserMapper userMapper;

    @Override
    public TpUser find(String phone, String password) {
        QueryWrapper<TpUser> wrapper= Wrappers.query();
        wrapper.eq("phone",phone);
        wrapper.eq("password",password);
        return userMapper.selectOne(wrapper);
    }
}
